import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
from selenium.webdriver.support.select import Select
testCase="DBshop017_后台商品管理-添加属性组流程"
groupname='好好学习'

firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,'商品管理','商品属性','属性分组')
firefox.find_element_by_xpath('//a[text()=" 添加属性组"]').click()
firefox.find_element_by_xpath('//input[@class="span6"]').send_keys(groupname)
firefox.find_element_by_xpath('//input[@class="span1"]').clear()
firefox.find_element_by_xpath('//input[@class="span1"]').send_keys(1)
firefox.find_element_by_xpath('//button').click()
time.sleep(2)

a=firefox.find_element_by_xpath('//table/tbody/tr[1]/td[2]').text
if a==groupname:
    writeLog("%s 测试通过"%testCase)
    print("%s 测试通过"%testCase)
else:
    writeLog("%s 测试失败" % testCase)
    print("%s 测试失败" % testCase)

firefox.quit()
